<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('product', function (Blueprint $table) {
            $table->increments('id')->comment('产品表');
            $table->integer('business_id')->unsigned()->default(0)->comment('业务ID');
            $table->string('name')->comment('名称');
            $table->decimal('price', 8, 2)->unsigned()->comment('价格');
            $table->tinyInteger('type')->unsigned()->comment('类型：1-充值，2-积分卡预付，3-积分卡激活');
            $table->smallInteger('value')->unsigned()->comment('值：对应type');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('product');
    }
}
